package com.vhall.component.entity.record.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author shimingming
 * @since 2023/6/6 11:10
 */
@Getter
@AllArgsConstructor
public enum LiveStreamingTypeEnum {

    LIVE_BROADCAST(0, "直播"),
    PLAYBACK(1, "回放"),


    ;
    private Integer value;

    private String description;

    public static String getDescription(Integer value) {
        LiveStreamingTypeEnum parse = parse(value);
        if (parse != null) {
            return parse.getDescription();
        }
        return StringUtils.EMPTY;
    }

    public static LiveStreamingTypeEnum parse(Integer value) {
        for (LiveStreamingTypeEnum anEnum : LiveStreamingTypeEnum.values()) {
            if (anEnum.getValue().equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
}
